package com.example.springmvcdemo;

import org.springframework.web.bind.annotation.*;

@RestController
public class UserController {
    @RequestMapping("/hello1")
    public String hello1(){
        return "hello1";
    }

    //让他仅支持 GET 请求
    @RequestMapping(value = "/hello2",method = RequestMethod.GET )//想要支持其他方法,使用 {} 弄成数组
    public String hello2(){
        return "hello2";
    }

    @RequestMapping(value = "/hello3",method = {RequestMethod.GET,RequestMethod.POST})
    public String hello3(){
        return "hello3";
    }

    //缩减
    @GetMapping("/hello4")
    public String hello4(){
        return "hello4";
    }
    @PostMapping("/hello5")
    public String hellO5(){
        return "hello5";
    }
}
